package com.whcoding.mybatis.page.controller;


import com.whcoding.mybatis.page.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @program: spring-boot-learning
 * @description:
 * @author: whcoding
 * @create: 2022-03-07 20:43
 **/
@RestController
@RequestMapping("/dept")
public class DeptController {

	@Autowired
	private DeptService deptService;

	/**
	 * 查询全部数据
	 *
	 * @return
	 */
	@GetMapping("/queryAllDept")
	public ResponseEntity queryAllDept() {
		return ResponseEntity.ok(deptService.queryAllDept());
	}


	/**
	 * 分页查询数据
	 *
	 * @return
	 */
	@GetMapping("/page")
	public ResponseEntity page() {
		return ResponseEntity.ok(deptService.page());
	}
}
